# Contributor: Adam Jensen <adam@acj.sh>
# Maintainer: Adam Jensen <adam@acj.sh>
pkgname=wuzz
pkgver=0.5.0
pkgrel=22
pkgdesc="Interactive CLI tool for HTTP inspection"
options="net"
url="https://github.com/asciimoo/wuzz"
arch="all"
license="AGPL-3.0-only"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/asciimoo/wuzz/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

export GOPATH="$srcdir"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

prepare() {
	mkdir -p ${builddir%/*}
	mv "$srcdir"/$pkgname-$pkgver "$builddir"/
	default_prepare

	go mod download
	go mod tidy
}

build() {
	go build -v
}

check() {
	go test ./...
}

package() {
	install -Dm755 "$builddir/$pkgname" -t "$pkgdir"/usr/bin/
}

sha512sums="
dbed0076d15e87e4b13d817fc02cf853a4c1fa96b6c3647507a86e47a26619f40120b72c8df8a4b6afd2472e552998d5fad292efa0d62ce9d63149e4379d7715  wuzz-0.5.0.tar.gz
"
